<template>
    <div class="container">
        <van-nav-bar title="我的收藏" left-text="返回" left-arrow @click-left="onClickLeft">
            <template #right>
                <slot name="right-btn"></slot>
            </template>
        </van-nav-bar>

        <div class="inner-container">
            <van-cell-group>
                <van-cell class="engr-row" v-for="item in store_favorited_list"
                    @click="onSelect(item.list)"
                    is-link value="使用">
                    <template #title>
                        <van-row >
                            <van-col :span="4">
                                {{item.name}}
                            </van-col>
                            <van-image class="float-left" v-for="engr in item.list" :src="engr.icon" height="40" width="40"/>
                            <van-col :span="3" :offset="1">
                                <van-icon name="star-o"/>{{item.mark}}
                            </van-col>
                        </van-row>
                    </template>
                </van-cell>
            </van-cell-group>
        </div>
    </div>
</template>

<script>
import { CalcServer } from '../server/servers';

export default {
    name: "MyTeamLoadFavoriteList",

    computed:{
        store_favorited_list() {
            return this.$store.state.favorited_list;
        }
    },

    methods:{
        onClickLeft(){
            this.$emit("close")
        },
        // queryFavoriteLlist(){
        //     return CalcServer.queryAllFavorites();
        // },

        onSelect(list){
            this.$emit("select",list)
        }
    },
}
</script>

<style scoped>
.container {
    width: 450px;
    height: 750px;
    border-radius: 20px;
}

.inner-container {
    width: 450px;
    height: 650px;
    overflow-y: scroll;
    overflow-x: hidden;
}

.engr-row{
    height: 60px;
    line-height: 40px;
}

.engr-row /deep/ .van-cell__title{
    position: absolute;
    width: 80%;
    height: calc(100% - 20px);
    overflow: hidden;
}

.engr-row /deep/ .van-cell__value{
    width: 10% !important;
}

.engr-row /deep/ .van-cell__right-icon{
    /* position: relative; */
    height: 40px;
    line-height: 40px;
}

</style>
